    var dangqian = '2';
    var nowpage = 1
    jeDate({
		dateCell:"#startTime",
		format:"YYYY年MM月DD日 hh:mm:ss",
		isinitVal:true,
		isTime:true, //isClear:false,
		minDate:"2014-09-19 00:00:00",
		okfun:function(val){alert(val)}
    })
    jeDate({
		dateCell:"#endTime",
		format:"YYYY年MM月DD日 hh:mm:ss",
		isinitVal:true,
		isTime:true, //isClear:false,
		minDate:"2014-09-19 00:00:00",
		okfun:function(val){alert(val)}
	})

    laydate.render({
        elem: '#timedate1'
    });
    laydate.render({
        elem: '#timedate2'
    });
    var form1 = {
            size: 10,
            page: 1,
            orderCode: "",
            startTime: "",
            endTime: "",
            lowPrice: null,
            highPrice: null,
            status: "",
        }
    var form2 = {
        total: 2000,
        pageSize: 10,
        showTotal: true,
        showTo: true,
        change: function ( i ) {
            createContent( i );
        }
    }
    var $content = $( ".content" );
    function getTableData(form1){
        form1.startTime = document.getElementById('startTime').value.replace('年','-').replace('月','-').replace('日','')
        form1.endTime = document.getElementById('endTime').value.replace('年','-').replace('月','-').replace('日','')
        $.ajax({
        url:initObj.url + "/api/cashOrder/findCashOrder",
        // data:JSON.stringify(form1),
        data:form1,
        datatype:'json',
        type:'get',
        beforeSend: function(request) {
           request.setRequestHeader("token", form.token);
        //    console.log(form.token)
        },
        success:function(res){
            // console.log(res)
            document.getElementById('selectAll').innerHTML = ""
            for(var i=0;i<res.data.content.length;i++){
                // console.log(1)
                document.getElementById('selectAll').innerHTML += 
                "<li>"+(i+1)+"<span style='width:10vw;font-weight:bold;display:inline-block'>"+res.data.content[i].merchantNo+
                "</span><span style='width:15vw;display:inline-block'>"+res.data.content[i].orderCode+
                "</span><span style='width:15vw;display:inline-block'>"+res.data.content[i].createTime+
                "</span><span style='width:10vw;display:inline-block'>"+res.data.content[i].amount+
                "</span><span class='static' style='font-weight:bold;width:5vw;display:inline-block'>"+res.data.content[i].state+
                "</span><button style='color:#fff;background-color:#ccc;border-radius:15px;display:inline-block;margin-left:5vw' onclick='showDetail("+res.data.content[i].id+")'>查看详情</button></li>"
                if(res.data.content[i].state == 'WAIT'){
                    document.getElementsByClassName('static')[i].style.color = '#fe9368'
                    document.getElementsByClassName('static')[i].innerHTML = "审核中"
                }else if(res.data.content[i].state == 'FAIL'){
                    document.getElementsByClassName('static')[i].style.color = '#f91d1d'
                    document.getElementsByClassName('static')[i].innerHTML = "审核未通过"
                }else{
                    document.getElementsByClassName('static')[i].style.color = '#15b68f'
                    document.getElementsByClassName('static')[i].innerHTML = "审核通过"
                }
            
            }
            if(form2.total !== res.data.totalElements){
                form2.total = res.data.totalElements
                Helper.ui.page("#page-3", form2);
                nowpage++
            }
        }
        })
    }
    getTableData(form1)
    function createContent (i) {
        form1.page = i
        getTableData(form1)
	}
    function changeinfo(id,value){
        form1[id] = value
        // console.log(form1)
    }
    function search(){
        getTableData(form1)
    }
    function showDetail(id){
        $.ajax({
        url:initObj.url + "/api/cashOrder/cashDetails/" + id,
        // data:JSON.stringify(form1),
        datatype:'json',
        type:'get',
        beforeSend: function(request) {
           request.setRequestHeader("token", form.token);
        //    console.log(form.token)
        },
        success:function(res){
            console.log(res)
            document.getElementById('detail_amount').value = res.data.amount
            document.getElementById('detail_bankCard').value = res.data.bankCard
            document.getElementById('detail_bankName').value = res.data.bankName
            document.getElementById('detail_bankPhone').value = res.data.bankPhone
            document.getElementById('detail_bankUsername').value = res.data.bankUsername
            document.getElementById('detail_merchantNo').value = res.data.merchantNo
        }
        })
        document.getElementById('detail').style.display = "block"
    }
    function detail_close(){
        document.getElementById('detail').style.display = "none"
    }
    // document.getElementsByClassName('active')[0].style.backgroundColor = "#b679f5!important"
    // console.log(document.getElementsByClassName('active'))
    Helper.ui.page("#page-3", form2);